package com.chance.cc.crawler.development.command.trigger.domain.douyin;

import com.chance.cc.crawler.core.downloader.HttpPage;
import com.chance.cc.crawler.development.command.job.domain.douyin.custom.DouyinAccountPhoneCustomCrawlerScheduleJob;
import com.chance.cc.crawler.development.command.trigger.CrawlerJobTriggerCommand;
import com.chance.cc.crawler.meta.core.bean.CrawlerMetaConstant;

import static com.chance.cc.crawler.development.command.publish.douyin.DYPublishCrawlerJob.metaServerIP;
import static com.chance.cc.crawler.development.command.publish.douyin.DYPublishCrawlerJob.metaServerPort;

/**
 * @author bx
 * @date 2020/12/7 0007 11:15
 */
public class DYAccountForCustomPhoneScheduleTrigger {

    private static final String domainId = "douyin";

    public static final String crawlerKey = DouyinAccountPhoneCustomCrawlerScheduleJob.crawlerKey;
    public static final String tringgerKey = crawlerKey + "-cron";

    private static CrawlerJobTriggerCommand crawlerJobTriggerCommand =
            new CrawlerJobTriggerCommand(metaServerIP,metaServerPort);

    public static void main(String[] args) {
        publishDYSearchScheduleTriggerInfo();
    }


    public static void publishDYSearchScheduleTriggerInfo(){

        HttpPage page = crawlerJobTriggerCommand.addOrUpdateScheduleCrawlerTrigger(
                crawlerKey,
                tringgerKey,
                domainId,
                CrawlerMetaConstant.ScheduleJobTrigger_Simple,
                "",
                "抖音搜索手机每周二上午0点1分执行");
        System.out.println("添加手机调度： "+page.getRawText());
    }
}
